package factory;
/**
 * 抽象工厂模式
 */
public class AbstractFactory {

    public static void main(String[] args) {
        Factory dirosFactory = new DirosCategory();
        dirosFactory.createBlog();
        dirosFactory.createDownload();
        dirosFactory.createIndex();

        Factory superManFactory = new DirosCategory();
        superManFactory.createCommunity();
        superManFactory.createStudy();
    }

    public interface Factory {
        void createIndex();
        void createBlog();
        void createStudy();
        void createDownload();
        void createCommunity();
    }

    public static class DirosCategory implements Factory {
        @Override
        public void createIndex() {
            System.out.println("建立Diros的专属类别：首页");
        }

        @Override
        public void createBlog() {
            System.out.println("建立Diros的专属类别：博客");
        }

        @Override
        public void createStudy() {
            System.out.println("建立Diros的专属类别：学习");
        }

        @Override
        public void createDownload() {
            System.out.println("建立Diros的专属类别：下载");
        }

        @Override
        public void createCommunity() {
            System.out.println("建立Diros的专属类别：社区");
        }
    }

    public static class SuperManCategory implements Factory {
        @Override
        public void createIndex() {
            System.out.println("建立SuperMan的专属类别：首页");
        }

        @Override
        public void createBlog() {
            System.out.println("建立SuperMan的专属类别：博客");
        }

        @Override
        public void createStudy() {
            System.out.println("建立SuperMan的专属类别：学习");
        }

        @Override
        public void createDownload() {
            System.out.println("建立SuperMan的专属类别：下载");
        }

        @Override
        public void createCommunity() {
            System.out.println("建立SuperMan的专属类别：社区");
        }
    }

}